import http from './index'

interface User{
  loginname?: string,
  password?: string
}

// 登录
export const login = (info: User) => http.post('/user/login', info)

// 验证手机号是否被注册
export const testTelHanlder = (tel: string) => http.post('/user/docheckphone', { tel })

// 发送短信验证码
export const msgcodeHandler = (tel: string) => http.post('/user/dosendmsgcode', { tel })

// 验证短信验证码是否正确
export const telcodeHandler = (tel: string, telcode: string) => http.post('/user/docheckcode', { tel, telcode })

export const regfinishHandler = (tel: string, password: string) => http.post('/user/dofinishregister', { tel, password })